package com.cloudfun.campusshare.common.model.vo;

import com.cloudfun.campusshare.common.constant.BaseConstant;
import com.cloudfun.campusshare.util.EnumInteger;
import com.cloudfun.campusshare.util.EnumString;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

/**
 * 烘干机操作VO
 * Created by Huqin on 2019/12/10
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "烘干设备信息")
public class DryerOperateVO {

    @ApiModelProperty(value = "设备识别码")
    @NotEmpty(message = "设备识别码不能为空")
    @Length(max = 40, message = "设备识别码过长，限制40个字")
    @JsonProperty("deviceId")
    private String imei;

    @ApiModelProperty(value = "设备类型")
    @NotEmpty(message = "设备类型不能为空")
    @EnumString(values = {BaseConstant.GGY8_NAME, BaseConstant.GGY13_5_NAME, BaseConstant.GGY6_NAME}, message = "设备类型错误")
    private String deviceType;

    @ApiModelProperty(value = "商户订单id")
    @NotEmpty(message = "商户订单id不能为空")
    @Length(max = 50, message = "订单id过长，限制50个字")
    private String orderId;

    @ApiModelProperty(value = "温度等级，1-4")
    @NotNull(message = "温度等级不能为空")
    @EnumInteger(values = {1, 2, 3, 4}, message = "温度等级错误")
    private Integer tempLevel;

    @ApiModelProperty(value = "及时使能等待时间，3-30")
    @NotNull(message = "及时使能等待时间不能为空")
    @Range(min = 3L, max = 30L, message = "及时使能等待时间错误")
    private Integer waitingTime;

    @ApiModelProperty(value = "烘干时间，0-65535")
    @NotNull(message = "烘干时间不能为空")
    @Range(min = 1L, max = 120L, message = "烘干时间错误")
    private Integer dryTime;

    @ApiModelProperty(value = "启动按钮是否有效")
    private Boolean startEnabled = true;

}
